
import React from 'react'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
import RouterStores from './Router'


const RouterAppExam = (param) => {
    return (
        <div>
            <Router>
                <div>
                    <ul style={{ height: '40px', width: "100 %", padding: '0' }} >
                        {RouterStores.map(item => {
                            return <li
                                style={{
                                    listStyleType: 'none',
                                    margin: '0 5px',
                                    float: 'left',
                                    lineHeight: '40px',
                                }}
                                key={item.key}>
                                <Link to={item.path}>{item.title}</Link>
                            </li>
                        })}
                    </ul>
                </div>
                <div>
                    {RouterStores.map(item => {
                        return <Route path={item.path} key={item.key} exact component={item.componet} />
                    })}
                </div>
            </Router>
        </div >
    )
}


export default RouterAppExam




